package com.zxp.springboot.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author zxp
 * @date 2021/8/3 11:44
 */
@Component
@Slf4j
public class AsyncTask {

    @Async("myTaskAsyncPool")
    public void doTask1(int i) throws InterruptedException{
        log.info("Task1"+i+" started.");
    }

    @Async
    public void doTask2(int i) throws InterruptedException{
        log.info("Task2-Native"+i+" started.");
    }
}
